﻿using Ninject.Modules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ninject.Extensions.Factory;
using WorldConqueror.Libraries.MVCExtensions.Helpers;
using WorldConqueror.Libraries.MVCExtensions.ModelBinders;
using System.Web.Mvc;

namespace WorldConqueror.Libraries.MVCExtensions
{
    public class MVCExtensionsModule : NinjectModule
    {

        public override void Load()
        {
            this.Bind<IModelBinder>().To<InterfaceModelBinder>();
            this.Bind<IModelBinder>().To<DefaultModelBinder>().WhenInjectedInto<InterfaceModelBinder>();
            
            this.Bind<IGenericFactory>().ToFactory();
            this.Bind<IMethodInfoHelper>().To<MethodInfoHelper>();
            this.Bind<IControllerContextWrapper>().To<ControllerContextWrapper>();
            this.Bind<IModelBindingContextWrapper>().To<ModelBindingContextWrapper>();
        }
    }
}
